package singletonDesign;

/**
 * @Auther: hdc
 * @Date: 2020/12/5 13:13
 * @Description: 终极单例模式，DCL ，指令重排
 */
public class MoreSingletonLazyDesign {
	private  static volatile  MoreSingletonLazyDesign singletonLazyDesign = null;

	public void  run(){

		System.out.println("O(∩_∩)O");
	}
	private  MoreSingletonLazyDesign(){

	}

	public static   MoreSingletonLazyDesign getSingletonLazyDesign(){

		if(singletonLazyDesign == null){
			synchronized (MoreSingletonLazyDesign.class){
				if(singletonLazyDesign == null){
					singletonLazyDesign = new MoreSingletonLazyDesign() ;

				}
			}
		}

		return  singletonLazyDesign ;
	}
}
